#ifndef XATTR_FILE_OPS_HPP
#define XATTR_FILE_OPS_HPP

//#include<memory>
#include<string>
#include"interfaces.hpp"

#define PARSER_EMU 1

namespace xattr{

#if PARSER_EMU
attribute_list parser(const std::string&log_file);
#endif


//This is the public interface of the security library
file_attribute get_history(const std::string&file_name);
bool trust_file(const std::string&file_name);
bool trust_directory(const std::string&file_name);
bool trust_tree(const std::string&file_name);


namespace file{//This is the low-level interface for the daemon
	attribute_list write_attribute_list(const attribute_list&);
	bool write_attributes(const file_attribute&);
	bool write_attribute(const std::string&file_path,const std::string&attr_name,const std::string&val);

	bool read_attribute(const std::string&file_name,const std::string&attr_name,std::string&val);
}//namespace file


namespace python{//This is the interface exported to python (in global namespace)
	bool write_attr_arr(
		const size_t path_len,const char*const path
		,const size_t name_len,const char*const name
		,const size_t val_len,const char*const val
	);
	bool write_attr_str(const char*const path,const char*const name,const char*const val);

	bool read_attr_arr(
		const size_t path_len,const char*const path
		,const size_t name_len,const char*const name
		,size_t*const val_len,char*const val//val_len is in-out; pass in the buffer size, pass out the read size
		,bool*const trust_it
	);
	bool read_attr_str(const char*const path,const char*const name,char*const val,bool*const trust_it);
}//namespace python

}//namespace xattr

#endif//XATTR_FILE_OPS_HPP
